package com.yhgm.mapper;

import com.yhgm.model.entity.UserLog;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

public interface UserLogDao {
    List<UserLog> findAll(Integer code, String msg, Integer page, Integer size);

    Integer count(Integer code,String msg);

    @Delete("delete from user_log")
    Integer clear();

    @Delete("delete from user_log where event_time<(select date_sub(now(),interval 3 month))")
    Integer clearThreeMonth();

    @Insert("insert into user_log(id, event_time, user_name, event_name) value(null,#{eventTime},#{userName},#{eventName})")
    Integer addOne(UserLog userLog);
}
